#include <iostream>
#include <fstream>
#include <io.h>
#include <time.h>
#include "ImageEvaluate.h"
#include "AnalisysImage.h"
#include "ImgQuaEv.h"
#include <vector>

int main(int argc, char* args[])
{

	if (argc == 2) {
		std::string imagePath = args[1];
		cv::Mat oriImage = cv::imread(imagePath, cv::IMREAD_ANYCOLOR | cv::IMREAD_ANYDEPTH);


		clock_t start = clock();
		//for (int i = 0; i < 10000; i++){
		//ImgEvaluate::midScore512(oriImage, imageParamss, 1);
		int R = oriImage.rows;
		int C = oriImage.cols;
		int startPosiY = R / 2;
		int startPosiX = C / 2;
		//double midScore = 0;
		//double instensity = 0.0;
		//cv::Mat midImage = oriImage(cv::Rect(startPosiX, startPosiY, 512, 512));
		//ImageQuaEv::midScoreSelf(midImage, midScore, instensity);

		std::vector<std::vector<double>> scoreHeatMapVector;
		std::vector<std::vector<double>> intensityHeatMapVector;
		//cv::Mat midImage = oriImage(cv::Rect(startPosiX, startPosiY, 512, 512));
		ImageQuaEv::ScoreHeatMapSelf(oriImage, scoreHeatMapVector, intensityHeatMapVector);
		clock_t end = clock();
		//std::cout << (double)(end - start) / CLOCKS_PER_SEC << std::endl;
		std::cout << imagePath << std::endl;
		if (scoreHeatMapVector.size()) {
			for (size_t iy = 0; iy < scoreHeatMapVector.size(); ++iy) {
				for (size_t ix = 0; ix < scoreHeatMapVector[0].size(); ++ix) {
					std::cout << "  scoreHeatMapVector : " << iy << "," << ix << "," << scoreHeatMapVector[iy][ix] << std::endl;
				}
			}
		}
	}
	return 0;
}
